# include <stdio.h>
# include <conio.h>
# include <math.h>

double f(double);

void main()
{
  double a,b,e,x,x0;
  printf("a=");
  scanf("%lg",&a);
  printf("b=");
  scanf("%lg",&b);
  printf("e=");
  scanf("%lg",&e);
  x=(a+b)/2;
  do
    {
      if((f(a)*f(x))>0)
	a=x;
      else
	b=x;
      x0=x;
      x=(a+b)/2;
    }
  while(fabs(x-x0)>e);
  printf("\n x=%g",x);

  getch();
};

double f(double x)
{
  return 3*x*x*x*x+4*x*x*x-12*x*x-5;
};
